#pragma once

#include <string>

#define CR_ENABLE_HASHED_STRING_DEBUGGING	1

namespace cr
{
	class HashedString
	{
	public:

		HashedString();
		HashedString(const HashedString& hsOther);
		HashedString(const char* szString);
		HashedString(const std::string& szString);

		HashedString( uint32_t hash )
		{
			Set( hash );
		}

		void Set( uint32_t hash )
		{
			m_hash = hash;
		}

		void Set( const char* szString );

		bool operator < ( const HashedString& other ) const
		{
			return m_hash < other.m_hash;
		}

		bool operator == ( const HashedString& other ) const
		{
			return m_hash == other.m_hash;
		}

		operator uint32_t() const
		{
			return m_hash;
		}

		void Reset()
		{
			m_hash = 0;
		}

		uint32_t GetHash() const
		{
			return m_hash;
		}

#if CR_ENABLE_HASHED_STRING_DEBUGGING
		const char* GetString() const;
#else
		const char* GetString() const	{ return ""; }
#endif

	private:

		uint32_t	m_hash;
	};
}